<template>
  <el-config-provider :locale="elementLocale">
    <!-- 原有布局内容 -->
     <router-view />
  </el-config-provider>
</template>

<script setup>
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import en from 'element-plus/dist/locale/en.mjs'

const { locale } = useI18n()
const elementLocale = computed(() => (locale.value === 'zh' ? zhCn : en))
</script>

<style>
  body.dark-theme {
    background: #333;
    color: #fff;
  }
</style>